//***************************************************************************
//*
//*	File:			dswl_configuration.h
//*	Description:	Wrapper for IConfiguration interface
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			_DSWL_CONFIGURATION_H_INCLUDED
#define			_DSWL_CONFIGURATION_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- dswl_configuration.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

#ifdef			_DSWL_SWITCH_USE_AUTOCAST
#ifdef			_DSWL_SWITCH_USE_UNSAFE_AUTOCAST
#pragma	message ( "-- dswl_configuration.h \t Warning: Generating auto-cast operator: CIConfiguration::operator IConfiguration* () const" )
#else
#pragma	message ( "-- dswl_configuration.h \t Warning: Generating auto-cast operator: CIConfiguration::operator       IConfiguration* ()" )
#pragma	message ( "-- dswl_configuration.h \t Warning: Generating auto-cast operator: CIConfiguration::operator const IConfiguration* () const" )
#endif
#endif

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//------------------------------------------------------ FORWARD DECLARATIONS
//

class			CIApplication	;
class			CIConfigurations;
class			CIGenericProject;

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CIConfiguration
//***************************************************************************
//*		@CLASS		Wrapper for IConfiguration interface
//***************************************************************************
class _DSWL_EXT_CLASS CIConfiguration  
{
	//																								
	//-----------------------------------------------------------------------						
	//***************************     ATTRIBS     ***************************						
	//-----------------------------------------------------------------------						
	//																								
private:																															// @ACCESS	Private Attributes	
			CComPtr< IConfiguration >	m_pIConfiguration			;																// @CMEMBER	Smart pointer to the actual configuration interface
																															
	//																															
	//-----------------------------------------------------------------------													
	//*************************     PROPERTIES     **************************										
	//-----------------------------------------------------------------------													
	//																															
public:																																// @ACCESS	Public Property Methods
			CIApplication				GetApplication				( void )											const	;	// @CMEMBER	Determines the application this document belongs to
			CIConfigurations			GetConfigurations			( void )											const	;	// @CMEMBER	Determines the configuration container this configuration belongs to
			CIGenericProject			GetProject					( void )											const	;	// @CMEMBER	Determines the project this configuration belongs to
																														
			CString						GetName						( void )											const	;	// @CMEMBER	Determines the configuration's name
																														
	//																														
	//-----------------------------------------------------------------------												
	//*************************     INFORMATION     *************************									
	//-----------------------------------------------------------------------												
	//																														
public:																																// @ACCESS	Public Information Methods
			BOOL						IsNull						( void )											const	;	// @CMEMBER	Determines whether the internal pointer is <t NULL>
			BOOL						IsValid						( void )											const	;	// @CMEMBER	Determines whether the internal pointer differs from <t NULL>
																														
	//																																		
	//-----------------------------------------------------------------------																
	//************************     MODIFICATION     *************************									
	//-----------------------------------------------------------------------																
	//																																		
public:																																// @ACCESS	Public Modification Methods
			void						AddFileSettings				( const	CString&			a_strFile			
																	, const	CString&			a_strSettings		)			;	// @CMEMBER	Adds the specified settings to the specified file in this configuration
			void						AddToolSettings				( const	CString&			a_strTool			
																	, const	CString&			a_strSettings		)			;	// @CMEMBER	Adds the specified tool settings to the configuration
			void						AddCustomBuildStep			( const	CString&			a_strCommand		
																	, const	CString&			a_strOutput			
																	, const CString&			a_strDescription	)			;	// @CMEMBER	Adds the specified custom build step to the configuration
			void						AddCustomBuildStepToFile	( const	CString&			a_strFile			
																	, const	CString&			a_strCommand		
																	, const	CString&			a_strOutput			
																	, const CString&			a_strDescription	)			;	// @CMEMBER	Adds the specified custom build step to the specified file in this configuration
																													
			void						RemoveFileSettings			( const	CString&			a_strFile			
																	, const	CString&			a_strSettings		)			;	// @CMEMBER	Removes the specified settings from the specified file in this configuration
			void						RemoveToolSettings			( const	CString&			a_strTool			
																	, const	CString&			a_strSettings		)			;	// @CMEMBER	Removes the specified tool settings from the configuration
																													
			void						MakeCurrentSettingsDefault	( void )													;	// @CMEMBER	Makes the current settings the default settings

	//																																
	//-----------------------------------------------------------------------														
	//****************************     BUILD     ****************************									
	//-----------------------------------------------------------------------														
	//																																
public:																																// @ACCESS	Public Build Methods
			void						Clean						( void )													;	// @CMEMBER	Cleans the configuration and all of its dependencies
			void						Build						( void )													;	// @CMEMBER	Builds the configuration and all of its dependencies
			void						RebuildAll					( void )													;	// @CMEMBER	Rebuilds the configuration and all of its dependencies
			void						Execute						( void )													;	// @CMEMBER	Executes the configuration
																																
			long						GetErrors					( void )											const	;	// @CMEMBER	Determines the number of errors that occured during the last build
			long						GetWarnings					( void )											const	;	// @CMEMBER	Determines the number of errors that occured during the last build
																													
	//																										
	//-----------------------------------------------------------------------								
	//**************************     OPERATORS     **************************								
	//-----------------------------------------------------------------------								
	//																										
public:																																// @ACCESS	Public Operators
			bool						operator	==				( const CIConfiguration&	a_Other				)	const	;	// @CMEMBER	Comparison operator
			bool						operator	!=				( const CIConfiguration&	a_Other				)	const	;	// @CMEMBER	Comparison operator
			bool						operator	<=				( const CIConfiguration&	a_Other				)	const	;	// @CMEMBER	Comparison operator
			bool						operator	>=				( const CIConfiguration&	a_Other				)	const	;	// @CMEMBER	Comparison operator
			bool						operator	<				( const CIConfiguration&	a_Other				)	const	;	// @CMEMBER	Comparison operator
			bool						operator	>				( const CIConfiguration&	a_Other				)	const	;	// @CMEMBER	Comparison operator
																													
			CIConfiguration&			operator	=				(		IConfiguration*		a_pIOther			)			;	// @CMEMBER	Copy operator
																													
			IConfiguration*				operator	*				( void )													;	// @CMEMBER	Dereference operator
	const	IConfiguration*				operator	*				( void )											const	;	// @CMEMBER	Dereference operator
																															
			IConfiguration*				operator	->				( void )													;	// @CMEMBER	Member access operator
	const	IConfiguration*				operator	->				( void )											const	;	// @CMEMBER	Member access operator
																														
	#ifdef	_DSWL_SWITCH_USE_AUTOCAST																					
	#ifdef	_DSWL_SWITCH_USE_UNSAFE_AUTOCAST																			
										operator					IConfiguration*	( void )							const	;	// @CMEMBER	TypeCast operator
	#else																												
										operator					IConfiguration*	( void )									;	// @CMEMBER	TypeCast operator
										operator	const			IConfiguration*	( void )							const	;	// @CMEMBER	TypeCast operator
	#endif																											
	#endif																											
																											
	//																										
	//-----------------------------------------------------------------------								
	//***********************     CON/DESTRUCTION     ***********************								
	//-----------------------------------------------------------------------								
	//																										
public:																																// @ACCESS	Public Con-/Destruction Methods	
			 CIConfiguration( IConfiguration* a_pIConfiguration = NULL );															// @CMEMBER	Default constructor
	virtual ~CIConfiguration();																										// @CMEMBER	Default destructor
};
//***************************************************************************
//**	@END
//***************************************************************************

#endif		// _DSWL_CONFIGURATION_H_INCLUDED
